package com.inspur.humantask.service;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.ResponseEntity;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.client.RestTemplate;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;

//import util.tool.PropertiesUitl;
@Component
public class SyncService {

	@Autowired
	JdbcTemplate jdbcTemplate;
	
	
	
//	,String humanTaskId
	public Object testKey(String formJson,String activitName,String humanTaskId)   {
		/*String processId="3182897";
		String bussinKeySql= "select KEY_ from  scidc.act_re_procdef WHERE ID_=(select PROC_DEF_ID_ from scidc.ACT_HI_PROCINST  where PROC_INST_ID_= "+processId+")";
		System.out.println(bussinKeySql);
		String key=jdbcTemplate.queryForList(bussinKeySql, String.class).get(0);

		String keyConfig="select * from scidc.t_dic where dic_type='"+key+"'";
		System.out.println(keyConfig);
		List<Map<String, Object>> mconfigs=jdbcTemplate.queryForList(keyConfig) ;
	//	formJson="{\"demandTitle\":\"物理机222\",\"priorityCode\":\"teji\",\"destPeopleId\":\"883\",\"destPeople\":\"张艳红\",\"destDepartment\":\"运营支撑部/技术二组\",\"destEmail\":\"zhangyanhong@cmss.chinamobile.com\",\"destPhone\":\"18896725390\",\"amount\":\"2\",\"cost\":\"0.0033\",\"vmList\":\"[{\\\"rowId\\\":\\\"\\\",\\\"area\\\":\\\"无锡\\\",\\\"resourcePool\\\":\\\"研发区\\\",\\\"purposeType\\\":\\\"项目\\\",\\\"name\\\":\\\"江西移动2016年业务支撑分布式数据库软件维保项目\\\",\\\"code\\\":\\\"R201685554\\\",\\\"kernelNumber\\\":\\\"2\\\",\\\"memory\\\":\\\"2\\\",\\\"hardDisk\\\":\\\"2\\\",\\\"demandDes\\\":\\\"222\\\",\\\"focusType\\\":\\\"1\\\",\\\"useScene\\\":\\\"产品开发\\\",\\\"purposeClassify\\\":\\\"持续集成\\\",\\\"useType\\\":\\\"自用\\\",\\\"applyNumber\\\":\\\"2\\\",\\\"user\\\":\\\"张艳红\\\",\\\"userId\\\":\\\"883\\\",\\\"userDeptId\\\":\\\"1113\\\",\\\"userMobile\\\":\\\"18896725390\\\",\\\"mailbox\\\":\\\"zhangyanhong@cmss.chinamobile.com\\\",\\\"purpose\\\":\\\"22\\\",\\\"endTime\\\":\\\"2019-12-19\\\"}]\",\"price\":\"0.02\",\"applyUserRole\":\"false\",\"isOrg\":\"true\",\"deptId\":\"1113\",\"dealProcessDatas\":[]}";
		JSONObject mFormJson =  JSONObject.parseObject(formJson);
		List<Map> mInsertList=new ArrayList<>();
		
		for(int i=0;i<rooms.length();i++) {
			personIds.put(((JSONObject)rooms.get(i)).get("NAME")+"",((JSONObject)rooms.get(i)).get("ID")+"" );
		}
		
		
		
		
		

		for(Map arg:mconfigs) {
			HashMap m=new HashMap<String,String>();
			m.put("name", mFormJson.get(arg.get("dic_value")));
			m.put("newValue",mFormJson.get(arg.get("dic_key")));
			m.put("activitName",activitName);
			
			
			
			
		}*/

		System.out.println('a');


		return null;

	//	return	rooms.get("data");


	}



}
